package cn.wj.school.common.enums;


import java.util.HashMap;
import java.util.Map;

/**
 * @Author: yueding
 * @Description: 信息类别,指定处理的bean
 * @Date: Created in 15:26 2018/12/27
 * @Modified By: yueding Copyright(c) cai-inc.com
 */
public enum MsgType {
    PING(1, "pingManager"), LOGIN(3, "loginManager"), LOGINOUT(4, "loginOutManager");

    private int type;

    private String beanName;

    MsgType(int type, String beanName) {
        this.type = type;
        this.beanName = beanName;
    }

    private static Map<Integer, String> beanMap = new HashMap<>();

    static {
        for (MsgType msg : MsgType.values()) {
            beanMap.put(msg.getType(), msg.getBeanName());
        }
    }

    public static Map getBeanMap() {
        return beanMap;
    }

    public int getType() {
        return type;
    }

    public String getBeanName() {
        return beanName;
    }
}
